class Book
  def title ; end
  def subtitle ; end
  def lend_to(user)
    puts "Lending to #{user}"
  end
  def self.deprecated(old_method, new_method)
    define_method(old_method) do |*args, &block|
      warn "Warning: #{old_method}() is deprecated. Please use `#{new_method}()` instead."
      send(new_method, *args, &block)
    end
  end
  # 拦截旧方法调用并转发给新方法
  deprecated :GetTitle, :title
  deprecated :LEND_TO_USER, :lend_to
  deprecated :title2, :subtitle
end